Skip to content

Conversation

andrewheard
Copy link
Contributor

@andrewheard andrewheard commented Aug 27, 2025

WIP - needs unit test for unary-success-empty-part.json

Added handling for GenerateContentResponse values that contain no parts. When streaming, these are skipped since the developer can't act upon them. In unary calls, throws only if all candidates are empty since, unlike streaming, no additional responses will be returned by the backend (and therefore an empty response would be an error).

This PR resolves current decoding issues when using the gemini-2.5-flash-image-preview model with the Gemini Developer API, as well as hardening the decoding against malformed responses that were being returned by Vertex AI (now fixed in the backend).

#no-changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant